<script setup>
import {ref} from 'vue'
import {useRouter} from "vue-router";

const router = useRouter()
// 加了点注释
const toDemo = () => {
  // router  name:lxp
  router.push({
    path: '/demo',
    query: {

      id: 999
    }
  })
}
const toHello = () => {
  router.push({
    name: 'hello',
    query: {
      id: 999
    }
  })
}
</script>

<template>
  <div id="d1">

    <div id="d2">
      <RouterLink to="/demo">去demo</RouterLink>
      <br>
      <RouterLink to="/hello">去hello</RouterLink>
      <br>
      <button @click="toDemo">去demo</button>
      <el-button type="primary">去demo</el-button>
      <el-button type="primary" size="large">去demo</el-button>
      <br>
      <button @click="toHello">去hello</button>
    </div>
    <div id="d3">
      <!--    表示当前路由指向哪儿，这里就是谁-->
      <RouterView/>
      <!--  div 所有demo的内容  -->
    </div>

  </div>
</template>

<style scoped>
h1{
  color: red;
}
#d1{
  display: flex;
}
#d2{
  width: 300px;
  height: 100%;
}
img{
  font-size: 15px;
}
</style>
<!--组长提交了代码-->
<!--组员写代码-->
<!--戴夫也加一个-->
<!--组长在这里加了个菜单-->
<!--我在lxp分支写了代码-->
<!--master分支能看到我吗-->
<!--组员随便提交-->
<!--组长写了代码啊啊啊啊啊啊-->